import DataFile from DataFile
import System
import System.IO

data = Table.Read(argv[0])
bw = BinaryWriter(File.Open(argv[0] + ".basic", FileMode.Create))

n as int = Math.Sqrt(data.Length);
for i in range(n):
    for j in range(n):
        bw.Write(data[i + j * n, 2])

bw.Close()
